<?php

namespace App\Transformers;


use App\Models\OperationRecord;
use League\Fractal\TransformerAbstract;

class OperationTransformer extends TransformerAbstract
{

    public function transform(OperationRecord $item)
    {
        return [
            'id' => $item['id'],
            'school_id' => $item['school_id'] ,
            'coach_id' => $item['coach_id'] ,
            'coachname'=>$item->coach->name,
            'coachphoto' => $item->coach->photo,
            'km' => $item['km'] ,
            'startime'=>$item['startime'],
            'endtime' => $item['endtime'],
            'minute' => $item['minute'],
            'max' => $item['max'],
            'only' => $item['only'],
            'reserve' =>  $item['reserve'],
            'sum_period' => $item['sum_period'],
            'status' => $item['status'],
            'student_id' => $item['student_id'],
            'operation_time' => $item['operation_time'],
        ];
    }


}
